Skip to content

feat: database cleaner - #725

Closed
Paco161315 wants to merge 2 commits into
zimbadev:mainfrom
Paco161315:database-cleaner
Closed

feat: database cleaner#725
Paco161315 wants to merge 2 commits into
zimbadev:mainfrom
Paco161315:database-cleaner

Conversation

@Paco161315

@Paco161315 Paco161315 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Delete inactive players and their accounts after a long period of inactivity. It also cleans znote accounts for our offical crystal server account creator.

You can configure the level range and inactivity time at database_cleaner.lua

There is an ignoredNames sample list where you can add which characters you do not wish to auto-delete no matter what.

This system has been tested for a while in rookgaardtales.com now available for crystal server.

Delete inactive players and their accounts after a long period of inactivity.
It also cleans znote accounts for our offical crystal server account creator.

You can configure the level range and inactivity time at database_cleaner.lua

There is a ignoredNames sample list where you can add which characters you do not wish to auto-delete no matter what.

This system has been tested for a while in rookgaardtales.com now available for crystal server.
@jprzimba

Copy link
Copy Markdown
Collaborator

I think the config in lua
if not configManager.getBoolean(configKeys.CLEAN_DATABASE) then
return
end

need to be moved inside
function playerCleaner.onStartup()

@Paco161315

Copy link
Copy Markdown
Contributor Author

I think the config in lua if not configManager.getBoolean(configKeys.CLEAN_DATABASE) then return end

need to be moved inside function playerCleaner.onStartup()

My bad, sorry, It's done. I put there and forgot to move inside the function.
The original file doesn't has config boolean.

@jprzimba

Copy link
Copy Markdown
Collaborator

We're not going to merge, there are safer alternatives through phpMyAdmin itself.

@jprzimba jprzimba closed this May 19, 2026
@Paco161315

Copy link
Copy Markdown
Contributor Author

We're not going to merge, there are safer alternatives through phpMyAdmin itself.

Alright man, still useful, but I understand

@Paco161315

Paco161315 commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

We're not going to merge, there are safer alternatives through phpMyAdmin itself.

Uh I know it's closed but I made a safer version in case someone wants to try:

https://pastecode.io/s/e4bu33fr

Note: Put the:
if not configManager.getBoolean(configKeys.CLEAN_DATABASE) then return end

Outside so the global event again so, isn't even called if set false, just to avoid starting it without do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants